package com.example.dw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.dw.entity.Notify;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 通知Mapper接口
 * @author system
 * @since 2024-01-01
 */
@Mapper
public interface NotifyMapper extends BaseMapper<Notify> {

    /**
     * 获取通知列表（显示的）
     */
    @Select("SELECT n.*, news.newsName, news.newsContent FROM notify n " +
            "LEFT JOIN news ON n.newsid = news.newsid " +
            "WHERE n.isShow = '1' ORDER BY n.createdAt DESC")
    List<Notify> getNotifyList();
} 